package cn.hrlly.tao2shou.biz;

import com.zhy.http.okhttp.OkHttpUtils;

import cn.hrlly.tao2shou.other.Config;
import cn.hrlly.tao2shou.callback.ApplicationDetailsCallback;
import cn.hrlly.tao2shou.domain.Application;
import cn.hrlly.tao2shou.listener.OnApplicationDetailsListener;

/**
 * User: gengliang
 * Date: 2016-01-31
 * Time: 11:39
 */

public class ApplicationDetailsBizImpl implements ApplicationDetailsBiz {

    private OnApplicationDetailsListener onApplicationDetailsListener;

    public ApplicationDetailsBizImpl(OnApplicationDetailsListener onApplicationDetailsListener){
        this.onApplicationDetailsListener=onApplicationDetailsListener;
    }

    @Override
    public void getApplicationDetails(Application application) {
        OkHttpUtils
                .post()
                .url(Config.key_url)
                .addParams(Config.key_action,Config.action_application_details)
                .addParams(Config.key_application_id,application.getApplicationId())
                .build()
                .execute(new ApplicationDetailsCallback(onApplicationDetailsListener));
    }
}
